const express = require('express')
const app = express()

const bodyParser = require('body-parser')
app.use(bodyParser.urlencoded({extended:false}))

const session = require('express-session')
app.use(
    session({
        secret:'这是秘钥',
        resave:false,
        saveUninitialized:false
    })
)

app.set('view engine','ejs')
app.set('views','./views')
app.use('/public',express.static('./public'))

const str1 = require('./router/index.js')
app.use(str1)
const str2 = require('./router/user.js')
app.use(str2)
const str3 = require('./router/article.js')
app.use(str3)


app.listen(3000,()=>{
    console.log('http://127.0.0.1:3000');
    
})